<template>
  <div>
    原:{{ count }} 更新:{{ data }}
    <button @click="onclick">点击</button>
  </div>
</template>
<script setup>
import { ref, computed, watch } from "vue";

const count = ref(0);

const data = computed(() => {
  return count.value * 3;
});

watch(count, (a, b) => {
  console.log(`const${b}到const${a}`);
});

const onclick = () => {
  count.value++;
};
</script>

<style lang="scss" scoped></style>
